<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>slot-举例1</title>
    <style>
        .box{
            width: 100px;
            height: 100px;
            border: 1px solid;
            padding: 20px;
        }

        .item{
            width: 30px;
            height: 30px;
            background-color: greenyellow;
            border-radius: 30%;
        }
    </style>
</head>
<body>
<div id="app">
    <box>
        <item :message="message"></item>
    </box>
</div>
</body>
<script src="../../lib/vue.js"></script>
<script type="text/x-template" id="box">
    <div class="box">
        <slot></slot>
    </div>
</script>
<script type="text/x-template" id="item">
    <div class="item">
        {{message}}
    </div>
</script>
<script>

    var box = {
        template:'#box'
    }

    var item={
        props:['message'],
        template: '#item'
    }

    new Vue({
        el:'#app',
        components:{
            box,
            item
        },
        data:{
            message:'hello item'
        }
    })

</script>
</html>